package com.ruoyi.biz.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.biz.domain.BizProjectPlan;
import com.ruoyi.biz.mapper.BizProjectPlanMapper;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 项目板块管理Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-19
 */
@Service
public class BizProjectPlanService extends ServiceImpl<BizProjectPlanMapper, BizProjectPlan> {

    public List<BizProjectPlan> listByProjectId(Long projectId) {
        LambdaQueryWrapper<BizProjectPlan> wrapper = new LambdaQueryWrapper<>();
        wrapper.and(i -> i.eq(BizProjectPlan::getProjectId, projectId));
        return list(wrapper);
    }

    public List<BizProjectPlan> listByProjectIds(List<Long> projectIds,Integer type) {
        LambdaQueryWrapper<BizProjectPlan> wrapper = new LambdaQueryWrapper<>();
        wrapper.and(i -> i.in(BizProjectPlan::getProjectId, projectIds));
        wrapper.and(i -> i.eq(BizProjectPlan::getType, type));
        return list(wrapper);
    }
}
